//
//  PSWLoginVM.swift
//  kxf
//  密码登录
//  Created by Mac on 2024/3/4.
//

import Foundation
import UIKit

class PSWLoginVM: UIView {
    
    let selfHeight = kFitWidth(130)

    override init(frame:CGRect){
        super.init(frame: CGRect.init(x: 0, y: frame.origin.y, width: SCREEN_WIDHT, height: selfHeight))
        self.backgroundColor = .white
        self.isUserInteractionEnabled = true
        
        initUI()
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    lazy var phoneVm : LoginInputVM = {
        let vm = LoginInputVM.init(frame: CGRect.init(x: 0, y: kFitWidth(20), width: 0, height: 0))
        vm.textField.placeholder = "请输入手机号"
        vm.textField.keyboardType = .numberPad
        vm.maxLength = 11
        return vm
    }()
    lazy var pswVm : LoginInputVM = {
        let vm = LoginInputVM.init(frame: CGRect.init(x: 0, y: self.phoneVm.frame.maxY+kFitWidth(20), width: 0, height: 0))
        vm.textField.placeholder = "请输入密码"
        vm.textField.isSecureTextEntry = true
        
        return vm
    }()
}

extension PSWLoginVM{
    func initUI() {
        addSubview(phoneVm)
        addSubview(pswVm)
    }
}

